<?php

namespace App\Models;

use App\Models\Base\WorkTicketRating as BaseWorkTicketRating;

/**
 * 
 *
 * @property int $id
 * @property int $work_ticket_id 工单id
 * @property int|null $work_user_id 维护人员id
 * @property int|null $school_user_id 学校用户id
 * @property int $score 评分|100:满意,101:一般,102:不满意
 * @property string $content 评价内容
 * @property \Illuminate\Support\Carbon|null $created_at
 * @property \Illuminate\Support\Carbon|null $updated_at
 * @property \Illuminate\Support\Carbon|null $deleted_at
 * @property-read \App\Models\SchoolUser|null $schoolUser
 * @property-read \App\Models\WorkTicket|null $workTicket
 * @property-read \App\Models\WorkUser|null $workUser
 * @method static \Illuminate\Database\Eloquent\Builder|WorkTicketRating newModelQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|WorkTicketRating newQuery()
 * @method static \Illuminate\Database\Eloquent\Builder|WorkTicketRating onlyTrashed()
 * @method static \Illuminate\Database\Eloquent\Builder|WorkTicketRating query()
 * @method static \Illuminate\Database\Eloquent\Builder|WorkTicketRating whereContent($value)
 * @method static \Illuminate\Database\Eloquent\Builder|WorkTicketRating whereCreatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|WorkTicketRating whereDeletedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|WorkTicketRating whereId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|WorkTicketRating whereSchoolUserId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|WorkTicketRating whereScore($value)
 * @method static \Illuminate\Database\Eloquent\Builder|WorkTicketRating whereUpdatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|WorkTicketRating whereWorkTicketId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|WorkTicketRating whereWorkUserId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|WorkTicketRating withTrashed()
 * @method static \Illuminate\Database\Eloquent\Builder|WorkTicketRating withoutTrashed()
 * @mixin \Eloquent
 */
class WorkTicketRating extends BaseWorkTicketRating
{
	protected $fillable = [
		self::WORK_TICKET_ID,
		self::WORK_USER_ID,
		self::SCHOOL_USER_ID,
		self::SCORE,
		self::CONTENT
	];

	public function workTicket()
	{
		return $this->belongsTo(WorkTicket::class, self::WORK_TICKET_ID);
	}

	public function workUser()
	{
		return $this->belongsTo(WorkUser::class, self::WORK_USER_ID);
	}

	public function schoolUser()
	{
		return $this->belongsTo(SchoolUser::class, self::SCHOOL_USER_ID);
	}
}
